const set = (key: string, params: Record<string, any>) => {
  window.localStorage.setItem(key, JSON.stringify(params));
};

const get = (key: string) => {
  const result = JSON.parse(window.localStorage.getItem(key) || '{}');
  window.localStorage.removeItem(key);
  return result;
};
const getAll = (key: string) => {
  const result = JSON.parse(window.localStorage.getItem(key) || '{}');
  return result;
};

export default {
  set,
  get,
  getAll
};
